package com.fan.controller;

import com.fan.service.CourseService;
import com.sixth.until.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: self-tui-education
 * @description:
 * @author: 老范
 * @create: 2022-04-25 15:07
 **/
@RestController
@RequestMapping("/order")
public class FrontOrderController {
    @Autowired
    private CourseService courseService;


    //根据课程id查询学生和教师信息
    @PostMapping("course/queryAllCourseAndTeacherName/{id}")
    public CommonResult queryAllCourseAndTeacherName(@PathVariable String id){
        return courseService.queryAllCourseAndTeacherName(id);
    }


    //根据课程id查询章节和课时信息
    @PostMapping("course/chapter/findChapterById/{id}")
    public CommonResult findChapterById(@PathVariable String id){
        return courseService.findChapterById(id);
    }
}
